document.addEventListener('DOMContentLoaded', () => {
  // 获取当前设置
  chrome.storage.sync.get('reminderStrength', (data) => {
    const { reminderStrength } = data;
    
    // 更新UI以匹配当前设置
    const options = document.querySelectorAll('.setting-option');
    options.forEach(option => {
      if (option.dataset.value === reminderStrength) {
        option.classList.add('active');
      } else {
        option.classList.remove('active');
      }
    });
    
    // 添加点击事件监听器
    options.forEach(option => {
      option.addEventListener('click', () => {
        // 更新UI
        options.forEach(opt => opt.classList.remove('active'));
        option.classList.add('active');
        
        // 保存设置
        const newStrength = option.dataset.value;
        chrome.storage.sync.set({ reminderStrength: newStrength });
      });
    });
  });
}); 